package com.yny.administrator.android1607_meishi.avtivity;

import android.database.Cursor;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;

import com.yny.administrator.android1607_meishi.R;

public class CollectActivity extends AppCompatActivity {

    private ListView mLv;
    private SimpleCursorAdapter adapter;
    private Cursor cursorLv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_collect);
        mLv = (ListView) findViewById(R.id.lv);
        cursorLv = ContentsActivity.mDb.query("movie", new String[]{"_id","desc"}, null, null, null, null, null);
        adapter = new SimpleCursorAdapter(this, R.layout.clist_item, cursorLv, new String[]{"desc"}, new int[]{R.id.tv_comment},SimpleCursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
        mLv.setAdapter(adapter);
    }
}
